<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue.js + axios + api</title>
  <script src="https://cdn.staticfile.org/vue/2.7.0/vue.min.js"></script>
  <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
</head>
<body>
<h1>显示列表</h1>
<div id="vue_user">
    {{info}}
    <p v-for="u in info">{{u.username}}+{{u.password}}</p>
</div>
<script type="text/javascript">
    var vm = new Vue({
        el: '#vue_user',
        data: {
        },
        methods: {
        },
        data () {
            return {
              info: null
            }
        },
        mounted () {
              axios
                .get('/user/findAll')
                .then(response => (this.info = response.data))
                .catch(function (error) { // 请求失败处理
                  console.log(error);
                  });
              }
        })

</script>
</body>
</html>